﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Cliente.Master" AutoEventWireup="true" CodeBehind="PedidosCliente.aspx.cs" Inherits="ForrajeriaFRONT.PedidosCliente" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style4
        {
            width: 122px;
        }
        .style5
        {
            width: 172px;
        }
        .style6
        {
            width: 571px;
        }
        .style7
        {
            width: 104px;
        }
        .style8
        {
            width: 334px;
        }
        .style9
        {
            width: 146px;
        }
        .style10
        {
            width: 331px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"  EnablePartialRendering="true"></asp:ScriptManager>
    <asp:UpdatePanel ID="panelcito" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <div>
    
        <table class="style1">
            <tr>
                <td>
                    <asp:Label ID="lblProducto" runat="server" Text="Producto:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtProducto" runat="server" Width="150px"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="lblMarca" runat="server" Text="Marca:"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlMarca" runat="server" Width="150px">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:Label ID="lblEdad" runat="server" Text="Edad:"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlEdad" runat="server" style="margin-left: 0px" 
                        Width="150px">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:Button ID="btnBuscar" runat="server" CausesValidation="false" 
                        Height="27px" onclick="btnBuscar_Click" Text="Buscar" Width="127px" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblProducto0" runat="server" Text="Cantidad Necesaria:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtCantidad" runat="server" Width="150px"></asp:TextBox>
                </td>
                <td>
                    <asp:RangeValidator ID="rvCantidad" runat="server" 
                        ControlToValidate="txtCantidad" Display="Dynamic" ErrorMessage="*" 
                        ForeColor="Red" MaximumValue="10000" MinimumValue="1" Type="Integer" 
                        ValidationGroup="cantidad"></asp:RangeValidator>
                    <asp:RequiredFieldValidator ID="rfvCantidad" runat="server" 
                        ControlToValidate="txtCantidad" Display="Dynamic" ErrorMessage="*" 
                        ForeColor="Red" ValidationGroup="cantidad"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:Label ID="lblMensaje" runat="server" ForeColor="Red"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="7">
                    <asp:Label ID="lblProducto1" runat="server" 
                        Text="Seleccione el producto que desea agregar a su Pedido:"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    <div>
    
        <asp:GridView ID="gridDatos" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="codigo" ForeColor="#333333" GridLines="None" 
            onselectedindexchanged="gridDatos_SelectedIndexChanged" 
            OnSelectedIndexChanging="gridDatos_SelectedIndexChanging" Width="100%">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:BoundField DataField="nombreForraje" HeaderText="Producto" />
                <asp:BoundField DataField="descripcion" HeaderText="Descripcion" />
                <asp:BoundField DataField="Nombre" HeaderText="Marca" />
                <asp:BoundField DataField="peso" HeaderText="Peso" />
                <asp:BoundField DataField="descripcionEdad" HeaderText="Edad" />
                <asp:BoundField DataField="stockActual" HeaderText="Stock Actual" />
                <asp:BoundField DataField="precio" HeaderText="Precio por Kilo" />
                <asp:CommandField ButtonType="Image" CancelText="" EditText="" 
                    HeaderText="Seleccionar" InsertText="" NewText="" 
                    SelectImageUrl="~/images/selectBusqueda.jpg" SelectText="" 
                    ShowSelectButton="True" UpdateText="" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                HorizontalAlign="Center" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#EDEAE4" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
    
    </div>

    <div>
    
        <table class="style1">
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Su Pedido: "></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridPedido" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" EnableSortingAndPagingCallbacks="True" ForeColor="#333333" 
                        GridLines="None" OnRowDeleting="gridDatos_RowDeleting" 
                        onselectedindexchanged="gridDatos_SelectedIndexChanged1" Width="100%">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:BoundField DataField="nombreForraje" HeaderText="Producto" />
                            <asp:BoundField DataField="descripcion" HeaderText="Descripcion" />
                            <asp:BoundField DataField="Nombre" HeaderText="Marca" />
                            <asp:BoundField DataField="peso" HeaderText="Peso" />
                            <asp:BoundField DataField="descripcionEdad" HeaderText="Edad" />
                            <asp:BoundField DataField="cantidad" HeaderText="Cantidad" />
                            <asp:BoundField DataField="precioKilo" HeaderText="Precio por Kilo" />
                            <asp:BoundField DataField="precioTotal" HeaderText="Precio Total" />
                            <asp:CommandField ButtonType="Image" CancelText="" 
                                DeleteImageUrl="~/images/borrarABM.jpg" EditText="" HeaderText="Quitar" 
                                InsertText="" NewText="" SelectText="" ShowDeleteButton="True" 
                                ShowHeader="True" UpdateText="" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                            HorizontalAlign="Center" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#EDEAE4" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    
    </div>
    <div>

        <table class="style1">
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="style10">
                    &nbsp;</td>
                <td class="style8">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="style9">
                    <asp:Label ID="lblTotal" runat="server" BackColor="#006699" ForeColor="White"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="style10">
                    &nbsp;</td>
                <td class="style8">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="style9">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <table class="style1">
            <tr>
                <td class="style5">
                    <asp:Label ID="Label2" runat="server" Text="Seleccione una fecha:"></asp:Label>
                </td>
                <td class="style6">
                    <asp:CustomValidator ID="cvCalendar" runat="server" 
                        ClientValidationFunction="fechaSeleccionada" ErrorMessage="*" ForeColor="Red" 
                        onservervalidate="cvCalendar_ServerValidate" ValidationGroup="generar"></asp:CustomValidator>
                </td>
                <td>
                    <asp:Button ID="btnGenerarPedido" runat="server" CausesValidation="False" 
                        Height="31px" onclick="Button1_Click" Text="Gererar Pedido" Width="133px" />
                </td>
            </tr>
            <tr>
                <td class="style5">
                    &nbsp;</td>
                <td class="style6">
                    <asp:Calendar ID="calendar" runat="server" Width="183px"></asp:Calendar>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style5">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>

    </div>
    
    </ContentTemplate>
    
    </asp:UpdatePanel>
    
</asp:Content>
